// Promise.race会返回第一个fulfilled或者rejected新的promise实例
function promiseRace(promiseArr) {
    return new Promise((resolve, reject) => {
        promiseArr.forEach(p => {
            Promise.resolve(p).then(val => {
                resolve(val)
            },
                err => {
                    reject(err)
                }
            )
        })
    })
}